1// Insert menu illustration scene "Loops_sweep_spline.pov" 2// Author Friedrich A. Lohmueller, June-2012 3#version 3.7; 4global_settings{ assumed_gamma 1.0 } 5 6#default{ finish{ ambient 0.1 diffuse 0.9 }} 7#include "shapes.inc" 8#include "shapes2.inc" 9#include "colors.inc" 10#include "textures.inc" 11#include "stones.inc" 12#include "glass.inc" 13 14// #while + #for loops, sphere_sweep, spline curves 15 16#declare In_Path = "70 - Loop, sphere_sweep, spline/" 17#declare In_Path2 = "70 - Loop, sphere_sweep, spline/" 18 19 //#declare Typ = 107; // for tests 20 21#switch (Typ) //--------------------------------------------------------- 22// #while loops and #for loops/ 23#case(100) #declare Txt_Path="00 - while loop linear.txt" #break 24#case(102) #declare Txt_Path="02 - while loop quadratic 2D nested.txt" #break 25#case(103) #declare Txt_Path="03 - while loop cubic 3D nested.txt" #break 26 27#case(104) #declare Txt_Path="04 - while loop circular.txt" #break 28#case(107) #declare Txt_Path="07 - while loop linear helix.txt" #break 29#case(108) #declare Txt_Path="08 - while loop circular single helix.txt" #break 30 31#case(113) #declare Txt_Path="13 - while loop spiral.txt" #break 32#case(114) #declare Txt_Path="14 - while loop snail.txt" #break 33 34#case(120) #declare Txt_Path="20 - for_loop linear.txt" #break 35#case(122) #declare Txt_Path="22 - for_loop quadratic_2D nested.txt" #break 36#case(124) #declare Txt_Path="24 - for_loop cubic_3D nested.txt" #break 37 38 39// 42 - sphere_sweep and spline_curves/ 40#case(240) #declare Txt_Path="40 - sphere_sweep linear_spline.txt" #break 41#case(241) #declare Txt_Path="41 - sphere_sweep cubic_spline.txt" #break 42#case(242) #declare Txt_Path="42 - sphere_sweep b_spline.txt" #break 43 44#case(251) #declare Txt_Path="51 - spline linear_spline.txt" #break 45#case(252) #declare Txt_Path="52 - spline quadratic_spline.txt" #break 46#case(253) #declare Txt_Path="53 - spline cubic_spline.txt" #break 47#case(254) #declare Txt_Path="54 - spline natural_spline.txt" #break 48#case(255) #declare Txt_Path="55 - spline closed natural_spline.txt" #break 49 50 51#end // of '#switch (Typ)' ----------------------------------------------- 52//------------------------------------------------------------------------ 53//------------------------------ the Axes -------------------------------- 54#macro Axis_( AxisLen, Dark_Texture,Light_Texture) 55 union{ 56 cylinder { <0,-AxisLen,0>,<0,AxisLen,0>,0.05 57 texture{checker texture{Dark_Texture } 58 texture{Light_Texture} 59 translate<0.1,0,0.1>} 60 } 61 cone{<0,AxisLen,0>,0.2,<0,AxisLen+0.7,0>,0 62 texture{Dark_Texture} 63 } 64 } 65#end // of macro 66//------------------------------------------------------------------------ 67#macro AxisXYZ_( AxisLenX, AxisLenY, AxisLenZ, Tex_Dark, Tex_Light, 68 Rot_X,Rot_Y, ScaleX,ScaleY,ScaleZ) 69//--------------------- drawing of 3 Axes -------------------------------- 70union{ 71#if (AxisLenX != 0) 72 object { Axis_(AxisLenX, Tex_Dark, Tex_Light) rotate< 0,0,-90>}// x-Axis 73 text { ttf "arial.ttf", "x", 0.15, 0 texture{Tex_Dark} 74 rotate<Rot_X,Rot_Y,0> scale ScaleX translate <AxisLenX+0.05,0.4,-0.10> no_shadow} 75#end // of #if 76#if (AxisLenY != 0) 77 object { Axis_(AxisLenY, Tex_Dark, Tex_Light) rotate< 0,0, 0>}// y-Axis 78 text { ttf "arial.ttf", "y", 0.15, 0 texture{Tex_Dark} 79 rotate<Rot_X,0,0> scale ScaleY translate <-0.55,AxisLenY+0.15,-0.20> rotate<0,Rot_Y,0> no_shadow} 80#end // of #if 81#if (AxisLenZ != 0) 82 object { Axis_(AxisLenZ, Tex_Dark, Tex_Light) rotate<90,0, 0>}// z-Axis 83 text { ttf "arial.ttf", "z", 0.15, 0 texture{Tex_Dark} 84 rotate<Rot_X,Rot_Y,0> scale ScaleZ translate <-0.35,0.3,AxisLenZ+0.10> no_shadow} 85#end // of #if 86} // end of union 87#end// of macro "AxisXYZ( ... )" // end AxisXYZ_ macro 88//------------------------------------------------------------------------ 89#declare T_Dark = // axis textures 90texture { 91 pigment{ color rgb<1,0.55,0>} 92 finish { phong 1} 93} 94#declare T_Light = 95texture { 96 pigment{ color rgb<1,1,1>} 97 finish { phong 1} 98} 99//------------------------------------------------------------------------ 100//------------------------------------------------------------------------ 101#declare Blue_Background = 102sky_sphere{ pigment{ gradient <0,1,0> 103 color_map{ [0 color rgb<0.24,0.34,0.56>*1.5] 104 [0.5 color rgb<0.24,0.34,0.56>*0.7] 105 [0.5 color rgb<0.24,0.34,0.56>*0.7] 106 [1.0 color rgb<0.24,0.34,0.56>*1.5] 107 } 108 109 rotate< 0,0, 0> 110 111 scale 2 } 112 } // end of sky_sphere 113 114#macro Small_Clouds () 115// sky -------------------------------------------------------------- 116plane{<0,1,0>,1 hollow 117 texture{ pigment{ bozo turbulence 0.92 118 color_map { [0.00 rgb <0.20, 0.20, 1.0>*0.9] 119 [0.50 rgb <0.20, 0.20, 1.0>*0.9] 120 [0.70 rgb <1,1,1>] 121 [0.85 rgb <0.25,0.25,0.25>] 122 [1.0 rgb <0.5,0.5,0.5>]} 123 scale<1,1,1.5>*2.5 translate< 0,0,0> 124 } 125 finish {ambient 1 diffuse 0} } 126 scale 10000} 127// fog on the ground ------------------------------------------------- 128fog { fog_type 2 129 distance 250 130 color White 131 fog_offset 0.1 132 fog_alt 2.5 133 turbulence 1.8 134 } 135#end //------------------------------------------------------- 136//---------------------------------<<< settings of squared plane dimensions 137#declare RasterScale = 1.0; 138#declare RasterHalfLine = 0.025; 139#declare RasterHalfLineZ = 0.025; 140//------------------------------------------------------------------------- 141#macro Raster(RScale, HLine) 142 pigment{ gradient x scale RScale 143 color_map{[0.000 color rgbt<1,1,1,0>*0.6] 144 [0+HLine color rgbt<1,1,1,0>*0.6] 145 [0+HLine color rgbt<1,1,1,1>] 146 [1-HLine color rgbt<1,1,1,1>] 147 [1-HLine color rgbt<1,1,1,0>*0.6] 148 [1.000 color rgbt<1,1,1,0>*0.6]} } 149 #end// of Raster(RScale, HLine)-macro 150//------------------------------------------------------------------------- 151#declare Raster_Ground = 152plane { <0,1,0>, 0 // plane with layered textures 153 texture { pigment{color rgb<1,1,1>*1.1} 154 finish {ambient 0.45 diffuse 0.85}} 155 texture { Raster(RasterScale,RasterHalfLine ) rotate<0,0,0> } 156 texture { Raster(RasterScale,RasterHalfLineZ) rotate<0,90,0>} 157 translate<0,0.001,0> 158 } 159//------------------------------------------------------------------------ 160#declare Grass_Ground = 161plane { <0,1,0>, 0 162 texture{ pigment{ color rgb<0.35,0.65,0.0>*0.72 } 163 normal { bumps 0.75 scale 0.015 } 164 finish { phong 0.1 } 165 166 } // end of texture 167 } // end of plane 168//------------------------------------------------------------------------ 169#declare Sand_Ground = 170plane{ <0,1,0>, 0 171 texture{ pigment{ color rgb <1.00,0.95,0.8>} 172 normal { bumps 0.75 scale 0.025 } 173 finish { phong 0.1 } 174 } // end of texture 175 } // end of plane 176//------------------------------------------------------------------------ 177#declare Desert_Ground = 178plane{ <0,1,0>, 0 179 texture{ pigment{ color rgb <0.825,0.57,0.35>} 180 normal { bumps 0.75 scale 0.025 } 181 finish { phong 0.1 } 182 } // end of texture 183 } // end of plane 184 185//------------------------------------------------------------------------ 186 187 188 189 190 191//-------------------------------------------------------------------------------------------------------- 192//-------------------------------------------------------------------------------------------------------- 193#if (Typ=100) // In_Path,"00 - while loop linear.txt" 194Small_Clouds () 195object{ Grass_Ground } 196camera{ angle 50 location < 1.50, 1.50, -3.00> look_at< 0.0, 0.25, 3.00> right x*image_width/image_height} 197light_source{<1500, 2500,-2500> color rgb<1,1,1>*0.9} // sun light 198light_source{<1.50, 1.50,-3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 199object{ AxisXYZ_( 2.85, 2.75, 20, T_Dark, T_Light,10,-30, 0.45,0.45,0.85) scale 0.5} 200#include concat(In_Path,Txt_Path) 201#end 202 203#if (Typ=102) 204Small_Clouds () 205object{ Desert_Ground } 206camera{ angle 75 location < 0, 1.00, -3.00> look_at< 0.0,1.00,0> right x*image_width/image_height} 207light_source{<-1500, 2500,-2500> color rgb<1,1,1>*0.9} // sun light 208light_source{< 0, 1.00,-3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 209object{ AxisXYZ_( 3.85, 2.75, 20, T_Dark, T_Light, 0, 0, 0.45,0.45,0.85) scale 0.5} 210#include concat(In_Path,Txt_Path) 211#end 212 213#if (Typ=103) 214Small_Clouds () 215object{ Sand_Ground } 216camera{ angle 75 location < 0.00, 1.00, -3.00> look_at< 0.0,1.00,0> right x*image_width/image_height} 217light_source{<-1500, 2500,-2500> color rgb<1,1,1>*0.9} // sun light 218light_source{< 0.00, 1.00,-3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 219#include concat(In_Path,Txt_Path) 220#end 221 222#if (Typ=104)// circular 223Small_Clouds () 224object { Sand_Ground } 225camera{ angle 24 location < 4.50, 3.00, -4.50> look_at< 0.05, 0.45, 0.00> right x*image_width/image_height} 226light_source{<2500, 2500,-0000> color rgb<1,1,1>*0.9} // sun light 227light_source{<4.50, 3.00,-4.50> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 228object{ AxisXYZ_( 2.85, 2.25, 4.5, T_Dark, T_Light,30,-45, 0.45,0.45,0.55) scale 0.5} 229#include concat(In_Path,Txt_Path) 230#end 231 232#if (Typ=107)// circular 2d 233Small_Clouds () 234object { Sand_Ground } 235camera{ angle 45 location < 3.50, 2.50, -3.50> look_at< 0.05, 0.85, 0.00> right x*image_width/image_height} 236light_source{<2500, 2500,-0000> color rgb<1,1,1>*0.9} // sun light 237light_source{<3.50, 2.50,-3.50> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 238object{ AxisXYZ_( 2.85, 3.95, 5.5, T_Dark, T_Light,20,-50, 0.55,0.55,0.65) scale 0.5} 239#include concat(In_Path,Txt_Path) 240#end 241 242 243#if (Typ=108) 244object { Sand_Ground } 245Small_Clouds () 246camera{ angle 72 location < 2.00, 7.00, -6.50> look_at< 0.10, 0.90, 0.00> right x*image_width/image_height} 247light_source{<-1500, 1500,-2500> color rgb<1,1,1>*0.9} // sun light 248light_source{< 2.00, 7.00,-6.50> color rgb<0.9,0.9,1>*0.1} // flash light 249#include concat(In_Path,Txt_Path) 250#end 251 252#if (Typ=113) // 13 - while loop spiral.txt 253Small_Clouds () 254object{ Desert_Ground } 255camera{ angle 64 location < 0, 1.00, -3> look_at< 0.00, 1,0.00> right x*image_width/image_height} 256light_source{<-1500, 2500,-2500> color rgb<1,1,1>*0.9} // sun light 257light_source{< 0, 1.00, -3> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 258#include concat(In_Path,Txt_Path) 259#end 260 261#if (Typ=114) // 262object { Sand_Ground } 263Small_Clouds () 264camera{ angle 60 location < 2.00, 2.00,-2.00> look_at< 0.30, 0.95, 0.00> right x*image_width/image_height} 265light_source{<-1000, 1800,-2500> color rgb<1,1,1>*0.9} // sun light 266light_source{< 2.00, 2.00,-2.00> color rgb<0.9,0.9,1>*0.1} // flash light 267#include concat(In_Path,Txt_Path) 268#end 269 270 271// #for loops 272#if (Typ=120) // 20 - for_loop linear.txt 273object { Raster_Ground } 274Small_Clouds () 275camera{ angle 46 location < 7.00, 4.70,-5.00> look_at< 0, 0.7, 3.00> right x*image_width/image_height} 276light_source{<-2000, 2000,-2500> color rgb<1,1,1>*0.9} // sun light 277light_source{< 2.65, 1.50,-2.10> color rgb<0.9,0.9,1>*0.1} // flash light 278object{ AxisXYZ_( 2.75, 3.5, 14, T_Dark, T_Light,20,-45, 0.45,0.45,0.95) scale 1} 279#include concat(In_Path,Txt_Path) 280#end 281 282// #for loops 283#if (Typ=122) // 20 - for_loop linear.txt 284object { Raster_Ground } 285Small_Clouds () 286camera{ angle 46 location < 8.50, 7.70,-7.00> look_at< 3.5, 0.5, 2.00> right x*image_width/image_height} 287light_source{<-2000, 2000,-2500> color rgb<1,1,1>*0.9} // sun light 288light_source{< 8.50, 7.70,-7.00> color rgb<0.9,0.9,1>*0.1} // flash light 289object{ AxisXYZ_( 7.6, 2.5, 10, T_Dark, T_Light,20,-45, 0.65,0.65,1.25) scale 1} 290#include concat(In_Path,Txt_Path) 291#end 292 293 294// #for loops 295#if (Typ=124) // 20 - for_loop linear.txt 296object { Raster_Ground } 297Small_Clouds () 298camera{ angle 64 location < 6.50, 7.00,-5.00> look_at< 2.5, 2.0, 1.00> right x*image_width/image_height} 299light_source{<-2000, 2000,-2500> color rgb<1,1,1>*0.9} // sun light 300light_source{< 6.50, 7.00,-5.00> color rgb<0.9,0.9,1>*0.1} // flash light 301object{ AxisXYZ_( 5.2, 4.75, 15, T_Dark, T_Light,30,-45, 0.65,0.65,1.25) scale 1} 302#include concat(In_Path,Txt_Path) 303#end 304 305 306// In_Path2,"42 - sphere_sweep and spline_curves/" 307/*// 42 - sphere_sweep and spline_curves/ 308#case(240) #declare Txt_Path="40 - sphere_sweep linear_spline.txt" #break 309#case(241) #declare Txt_Path="41 - sphere_sweep cubic_spline.txt" #break 310#case(242) #declare Txt_Path="42 - sphere_sweep b_spline.txt" #break 311 312#case(251) #declare Txt_Path="51 - spline linear_spline.txt" #break 313#case(252) #declare Txt_Path="52 - spline quadratic_spline.txt" #break 314#case(253) #declare Txt_Path="53 - spline cubic_spline.txt" #break 315#case(254) #declare Txt_Path="54 - spline natural_spline.txt" #break 316#case(255) #declare Txt_Path="55 - spline closed natural_spline.txt" #break 317*/ 318// --- sphere_sweep 319#if (Typ=240) // 40 - sphere_sweep linear_spline.txt 320Small_Clouds () 321object{ Desert_Ground } 322camera{ angle 48 location < 0.00, 1.00, -3.00> look_at< 0, 0.9, 0> right x*image_width/image_height} 323light_source{<-1500, 2500, -2500> color rgb<1,1,1>*0.9} // sun light 324light_source{< 0.00, 1.00, -3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 325#include concat(In_Path2,Txt_Path) 326#end 327// --- 328#if (Typ=241) // 40 - sphere_sweep linear_spline.txt 329Small_Clouds () 330object{ Desert_Ground } 331camera{ angle 48 location < 0.00, 1.00, -3.00> look_at< 0, 0.9, 0> right x*image_width/image_height } 332light_source{<-1500, 2500, -2500> color rgb<1,1,1>*0.9} // sun light 333light_source{< 0.00, 1.00, -3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 334#include concat(In_Path2,Txt_Path) 335#end 336// --- 337#if (Typ=242) // 40 - sphere_sweep linear_spline.txt 338Small_Clouds () 339object{ Desert_Ground } 340camera{ angle 44 location < 0.00, 1.00, -3.00> look_at< 0, 0.9, 0> right x*image_width/image_height} 341light_source{<-1500, 2500, -2500> color rgb<1,1,1>*0.9} // sun light 342light_source{< 0.00, 1.00, -3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 343#include concat(In_Path2,Txt_Path) 344#end 345// --- spline curves 346#if (Typ=251) // 40 - sphere_sweep linear_spline.txt 347Small_Clouds () 348object{ Sand_Ground } 349camera{ angle 50 location < 0.00, 1.00, -3.00> look_at< 0, 1.05, 0> right x*image_width/image_height} 350light_source{<-1500, 2500, -2500> color rgb<1,1,1>*0.9} // sun light 351light_source{< 0.00, 1.00, -3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 352#include concat(In_Path2,Txt_Path) 353#end 354// --- 355#if (Typ=252) // 40 - sphere_sweep linear_spline.txt 356Small_Clouds () 357object{ Sand_Ground } 358camera{ angle 50 location < 0.00, 1.00, -3.00> look_at< 0, 1.05, 0> right x*image_width/image_height} 359light_source{<-1500, 2500, -2500> color rgb<1,1,1>*0.9} // sun light 360light_source{< 0.00, 1.00, -3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 361#include concat(In_Path2,Txt_Path) 362#end 363// --- 364#if (Typ=253) // 40 - sphere_sweep linear_spline.txt 365Small_Clouds () 366object{ Sand_Ground } 367camera{ angle 50 location < 0.00, 1.00, -3.00> look_at< 0, 1.05, 0> right x*image_width/image_height} 368light_source{<-1500, 2500, -2500> color rgb<1,1,1>*0.9} // sun light 369light_source{< 0.00, 1.00, -3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 370#include concat(In_Path2,Txt_Path) 371#end 372// --- 373#if (Typ=254) // 40 - sphere_sweep linear_spline.txt 374Small_Clouds () 375object{ Grass_Ground } 376camera{ angle 60 location < 0.00, 1.00, -3.00>look_at< 0, 1, 0> right x*image_width/image_height} 377light_source{<-1500, 2500, -2500> color rgb<1,1,1>*0.9} // sun light 378light_source{< 0.00, 1.00, -3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 379#include concat(In_Path2,Txt_Path) 380#end 381// --- 382#if (Typ=255) // 40 - sphere_sweep linear_spline.txt 383Small_Clouds () 384object{ Grass_Ground } 385camera{ angle 70 location < 0.00, 1.00, -3.00> look_at< 0, 0.95, 0> right x*image_width/image_height} 386light_source{<-1500, 2500, -2500> color rgb<1,1,1>*0.9} // sun light 387light_source{< 0.00, 1.00, -3.00> color rgb<0.9,0.9,1>*0.1 shadowless} // flash 388#include concat(In_Path2,Txt_Path) 389#end